package com.leetcode.array;

import java.util.Arrays;
import java.util.Scanner;

/**
 * Given an array of integers, find if the array contains any duplicates.
 *  Your function should return true if any value appears at least twice 
 *  in the array, and it should return false if every element is distinct.
 * @author Adiy
 *
 */
public class ContainsDuplicate {

	public static void main(String[] args){
		Scanner in=new Scanner(System.in);
		int k=in.nextInt();
		int[] nums=new int[k];
		for(int i=0;i<k;i++)
			nums[i]=in.nextInt();
		boolean flag=containsDuplicate(nums);
		System.out.println(flag);
	}
    public static boolean containsDuplicate(int[] nums) {
        Arrays.sort(nums);
        int i=0;
        if(nums.length<=1) return false; 
        for(i=0;i<nums.length-1;i++){
        	if(nums[i]==nums[i+1])
        		return true;
        }
        return false;
    }
}
